package com.rayo.accesscontrollercopy.model.db.bean;


import com.alibaba.fastjson.annotation.JSONField;
import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.PrimaryKey;
import com.litesuits.orm.db.enums.AssignType;
import com.rayo.accesscontrollercopy.config.NetworkConfig;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by yanghaojie on 16/7/13.
 */
public class BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final String EDIT_TIME = "editime";
    // 设置为主键,自增
    @PrimaryKey(AssignType.AUTO_INCREMENT)
    // 取名为“_id”,如果此处不重新命名,就采用属性名称
    @Column("_id")
    @JSONField(serialize = false)
    protected long id;

    //    // @Check条件检测
//    @Check("description NOT NULL")
//    public String description = "字段描述";


    // @Check条件检测
    @Column(EDIT_TIME)
    @JSONField(format= NetworkConfig.JSON_DATE_TIME,serialize = false)
    public Date editime;

//    @Ignore
//    private String ignore = "标记Ignore,并不会出现在数据库中";

    @Override
    public String toString() {
        return "BaseModel{" + "editime='" + editime.toString() + '\'' + '}';
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Date getEditime() {
        return editime;
    }

    public void setEditime(Date editime) {
        this.editime = editime;
    }
}
